---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.6.log
  log type:  text
 opened on:  12 May 2025, 16:46:09

. use "C:\Users\sbstjp\OneDrive - Cardiff University\voter_panel.dta" // Democracy Fund Voter Study Group. VIEW
> S OF THE ELECTORATE RESEARCH SURVEY. Washington, D.C. https://www.voterstudygroup.org/.  Date accessed: March
>  09, 2025.

. 
. // Create social justice scale
. *Delete missing
. replace ft_blm_2020Sep=. if ft_blm_2020Sep>100
(195 real changes made, 195 to missing)

. replace reparations_2020Sep=. if reparations_2020Sep>2
(1,207 real changes made, 1,207 to missing)

. replace defundpolice_2020Sep=. if defundpolice_2020Sep>2 
(906 real changes made, 906 to missing)

. replace police_threat_2020Sep=. if police_threat_2020Sep>2
(3 real changes made, 3 to missing)

. replace usa_founders_2020Sep=. if usa_founders_2020Sep>2
(1,913 real changes made, 1,913 to missing)

. replace internetharass_dem_2020Sep=. if internetharass_dem_2020Sep==9
(2,996 real changes made, 2,996 to missing)

. 
. *Reverse coding so social justice values are coded high
. foreach var in reparations_2020Sep defundpolice_2020Sep usa_founders_2020Sep {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' - `var'
  5. }
(7,824 missing values generated)
(7,523 missing values generated)
(8,530 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in ft_blm_2020Sep rreparations_2020Sep rdefundpolice_2020Sep rusa_founders_2020Sep police_threat_
> 2020Sep internetharass_dem_2020Sep {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
ft_blm_202~p |      5,705    50.44943    38.23238          0        100
(6,812 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rreparatio~p |      4,693    .2959727    .4565274          0          1
(7,824 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rdefundpol~p |      4,994    .2573088    .4371947          0          1
(7,523 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rusa_found~p |      3,987    .1662904    .3723879          0          1
(8,530 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
police_thr~p |      5,897     1.55825    .4966375          1          2
(6,620 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
i~em_2020Sep |      2,904    1.211088    .6539851          1          4
(9,613 missing values generated)

. 
. *At this stage, the scale has a Cronbach's alpha of 0.83
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values
. foreach var in sft_blm_2020Sep srreparations_2020Sep srdefundpolice_2020Sep srusa_founders_2020Sep spolice_th
> reat_2020Sep sinternetharass_dem_2020Sep {
  2.     replace `var' = 0 if missing(`var')
  3. }
(6,812 real changes made)
(7,824 real changes made)
(7,523 real changes made)
(8,530 real changes made)
(6,620 real changes made)
(9,613 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in sft_blm_2020Sep srreparations_2020Sep srdefundpolice_2020Sep srusa_founders_2020Sep spolice_th
> reat_2020Sep sinternetharass_dem_2020Sep {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(5,705 real changes made)
(5,705 real changes made)
(4,693 real changes made)
(4,693 real changes made)
(4,994 real changes made)
(4,994 real changes made)
(3,987 real changes made)
(3,987 real changes made)
(5,897 real changes made)
(5,897 real changes made)
(2,904 real changes made)
(2,904 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen SocJusValues = .
(12,517 missing values generated)

. replace SocJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(5,900 real changes made)

. 
. // Demographics
. *Delete missing values, generate age variable and rename
. replace faminc_2020Sep=. if faminc_2020Sep>20 
(772 real changes made, 772 to missing)

. gen age = 2020 - birthyr_2020Sep 
(6,617 missing values generated)

. rename gender_2020Sep FemaleGender 

. replace ideo5_2020Sep=. if ideo5_2020Sep==6 
(370 real changes made, 370 to missing)

. 
. *Generate dummy variables
. gen Graduate=.
(12,517 missing values generated)

. replace Graduate=1 if inlist(educ_2020Sep, 5, 6) 
(2,058 real changes made)

. replace Graduate=0 if inrange(educ_2020Sep, 1, 4)
(3,842 real changes made)

. 
. gen BIPOC=.
(12,517 missing values generated)

. replace BIPOC=0 if race_2020Sep==1
(4,059 real changes made)

. replace BIPOC = 1 if inrange(race_2020Sep, 2, 8) 
(1,841 real changes made)

. 
. // Standardize variables
. egen Age = std(age)
(6,617 missing values generated)

. egen Income = std(faminc_2020Sep)
(7,389 missing values generated)

. 
. // Regressions
. regress SocJusValues Age BIPOC FemaleGender Graduate Income [pweight=weight_genpop_2020Sep], robust 
(sum of wgt is 5,097.3252856289)

Linear regression                               Number of obs     =      5,128
                                                F(5, 5122)        =     209.69
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1822
                                                Root MSE          =     .27908

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0812644   .0045707   -17.78   0.000    -.0902248    -.072304
       BIPOC |   .1637306   .0102837    15.92   0.000     .1435702     .183891
FemaleGender |   .0636561   .0089098     7.14   0.000     .0461891     .081123
    Graduate |   .0565096   .0099114     5.70   0.000      .037079    .0759402
      Income |  -.0230686   .0049838    -4.63   0.000     -.032839   -.0132982
       _cons |   1.167303    .014681    79.51   0.000     1.138522    1.196084
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if ideo5_2020Sep<3 [pweight=weight_genpop_2020Sep
> ], robust 
(sum of wgt is 1,493.37025710126)

Linear regression                               Number of obs     =      1,563
                                                F(5, 1557)        =      31.64
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1042
                                                Root MSE          =     .20679

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0596781   .0057135   -10.45   0.000     -.070885   -.0484712
       BIPOC |   .0659505   .0124703     5.29   0.000     .0414901    .0904109
FemaleGender |   .0338761    .011971     2.83   0.005     .0103951    .0573571
    Graduate |   .0177303   .0121279     1.46   0.144    -.0060584     .041519
      Income |   -.010033    .006205    -1.62   0.106    -.0222039    .0021379
       _cons |   1.479053   .0202159    73.16   0.000     1.439399    1.518706
------------------------------------------------------------------------------

. eststo
(est2 stored)

. esttab

--------------------------------------------
                      (1)             (2)   
             SocJusValues    SocJusValues   
--------------------------------------------
Age               -0.0813***      -0.0597***
                 (-17.78)        (-10.45)   

BIPOC               0.164***       0.0660***
                  (15.92)          (5.29)   

FemaleGender       0.0637***       0.0339** 
                   (7.14)          (2.83)   

Graduate           0.0565***       0.0177   
                   (5.70)          (1.46)   

Income            -0.0231***      -0.0100   
                  (-4.63)         (-1.62)   

_cons               1.167***        1.479***
                  (79.51)         (73.16)   
--------------------------------------------
N                    5128            1563   
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.6.log
  log type:  text
 closed on:  12 May 2025, 16:46:28
---------------------------------------------------------------------------------------------------------------
